package com.ruoyi.core.controller;

import com.alibaba.fastjson.JSON;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.httpSdk.client.CommonClient;
import com.ruoyi.common.httpSdk.request.RefreshCookieRequest;
import com.ruoyi.common.httpSdk.sms.RefreshElvesResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author xiaom
 * @Date 2021/4/20 17:41
 * @Version 1.0.0
 * @Description <>
 **/
@RestController
@Validated
@RequestMapping("/test")
@Slf4j
public class TestController extends BaseController {

    @GetMapping(value = "/refreshElves")
    public AjaxResult testElvesRefreshCookie() throws Exception {
        RefreshCookieRequest request = new RefreshCookieRequest(RequestMethod.GET);
        request.setUsername("xiaoming6379@gmail.com");
        request.setPassword("chen1996119");
//        RefreshElvesResponse response = new CommonClient().execute(request);
//        log.info("cookie:" + JSON.toJSONString(response.getData()));
        return AjaxResult.success();
    }
}
